package com.zxing.practice.config;


import com.zxing.practice.config.vo.AjaxResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@Slf4j
@RestControllerAdvice
public class CustomExceptionHandler {

    @ExceptionHandler(value = Exception.class)
    public AjaxResult handleException(Exception e){
        log.error("System's exception come out: ", e);
        return AjaxResult.error(500, "unknown exception");
    }
}
